package com.kx.core.jdbc.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.kx.core.jdbc.dao.cluster.CityDao;
import com.kx.core.jdbc.dao.master.UserDao;
import com.kx.core.jdbc.domain.City;
import com.kx.core.jdbc.domain.User;
import com.kx.core.jdbc.service.UserService;

/**
 * 用户业务实现类
 * @author     Kangx.li 1703054
 * @version    V1 2018年11月23日
 * @since      Java
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserDao userDao;//主数据源
    @Autowired
    private CityDao cityDao;//从数据源
    
    @Override
    public User findByName(String userName) {
	User user = userDao.findByName(userName);
	City city = cityDao.findByName("温岭市");
	user.setCity(city);
	return user;
    }

}

